<!-- This comment will put IE 6, 7 and 8 in quirks mode -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>shark::TanhNeuron Struct Reference</title>
<script type="text/javaScript" src="search/search.js"></script>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3.0.1/es5/tex-mml-chtml.js"></script>
<script src="../../mlstyle.js"></script>
<link href="../css/besser.css" rel="stylesheet" type="text/css"/>
</head>
<!-- pretty cool: each body gets an id tag which is the basename of the web page  -->
<!--              and allows for page-specific CSS. this is client-side scripted, -->
<!--              so the id will not yet show up in the served source code -->
<script type="text/javascript">
    jQuery(document).ready(function () {
        var url = jQuery(location).attr('href');
        var pname = url.substr(url.lastIndexOf("/")+1, url.lastIndexOf(".")-url.lastIndexOf("/")-1);
        jQuery('#this_url').html('<strong>' + pname + '</strong>');
        jQuery('body').attr('id', pname);
    });
</script>
<body>
    <div id="shark_old">
        <div id="wrap">
            <div id="header">
                <div id="site-name"><a href="../../sphinx_pages/build/html/index.html">Shark machine learning library</a></div>
                <ul id="nav">
                    <li >
                        <a href="../../sphinx_pages/build/html/rest_sources/installation.html">Installation</a>
                    </li>
		    <li >
                        <a href="../../sphinx_pages/build/html/rest_sources/tutorials/tutorials.html">Tutorials</a>
                    </li>
		    <li >
                        <a href="../../sphinx_pages/build/html/rest_sources/benchmark.html">Benchmarks</a>
                    </li>
                    <li class="active">
                        <a href="classes.html">Documentation</a>
                        <ul>
                            <li class="first"></li>
                            <li><a href="../../sphinx_pages/build/html/rest_sources/quickref/quickref.html">Quick references</a></li>
                            <li><a href="classes.html">Class list</a></li>
                            <li class="last"><a href="group__shark__globals.html">Global functions</a></li>
                        </ul>
                    </li>
                </ul>
            </div>
        </div>
    </div>
<div id="doxywrapper">
<!--
    <div id="global_doxytitle">Doxygen<br>Documentation:</div>
-->
    <div id="navrow_wrapper">
<!-- Generated by Doxygen 1.9.8 -->
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespaceshark.html">shark</a></li><li class="navelem"><a class="el" href="structshark_1_1_tanh_neuron.html">TanhNeuron</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="structshark_1_1_tanh_neuron-members.html">List of all members</a> &#124;
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a>  </div>
  <div class="headertitle"><div class="title">shark::TanhNeuron Struct Reference<div class="ingroups"><a class="el" href="group__models.html">Models</a> &raquo; <a class="el" href="group__activations.html">Neuron activation functions</a></div></div></div>
</div><!--header-->
<div class="contents">

<p>Neuron which computes the hyperbolic tangenst with range [-1,1].  
 <a href="structshark_1_1_tanh_neuron.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="_neuron_layers_8h_source.html">shark/Models/NeuronLayers.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-types" name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:acc12c52782340838b649e718de0c3507" id="r_acc12c52782340838b649e718de0c3507"><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="structshark_1_1_empty_state.html">EmptyState</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structshark_1_1_tanh_neuron.html#acc12c52782340838b649e718de0c3507">State</a></td></tr>
<tr class="separator:acc12c52782340838b649e718de0c3507"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a9107cae5619ca79f8fac8a2370b07f81" id="r_a9107cae5619ca79f8fac8a2370b07f81"><td class="memTemplParams" colspan="2">template&lt;class Arg &gt; </td></tr>
<tr class="memitem:a9107cae5619ca79f8fac8a2370b07f81"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="structshark_1_1_tanh_neuron.html#a9107cae5619ca79f8fac8a2370b07f81">evalInPlace</a> (Arg &amp;arg) const</td></tr>
<tr class="separator:a9107cae5619ca79f8fac8a2370b07f81"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a017e84210491223766b0498e4bae5028" id="r_a017e84210491223766b0498e4bae5028"><td class="memTemplParams" colspan="2">template&lt;class Arg &gt; </td></tr>
<tr class="memitem:a017e84210491223766b0498e4bae5028"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="structshark_1_1_tanh_neuron.html#a017e84210491223766b0498e4bae5028">evalInPlace</a> (Arg &amp;arg, <a class="el" href="structshark_1_1_tanh_neuron.html#acc12c52782340838b649e718de0c3507">State</a> &amp;) const</td></tr>
<tr class="separator:a017e84210491223766b0498e4bae5028"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a89a6085add59e60b91b2ece71e8831d9" id="r_a89a6085add59e60b91b2ece71e8831d9"><td class="memTemplParams" colspan="2">template&lt;class Output , class Derivative &gt; </td></tr>
<tr class="memitem:a89a6085add59e60b91b2ece71e8831d9"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="structshark_1_1_tanh_neuron.html#a89a6085add59e60b91b2ece71e8831d9">multiplyDerivative</a> (Output const &amp;output, Derivative &amp;der, <a class="el" href="structshark_1_1_tanh_neuron.html#acc12c52782340838b649e718de0c3507">State</a> const &amp;) const</td></tr>
<tr class="separator:a89a6085add59e60b91b2ece71e8831d9"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Neuron which computes the hyperbolic tangenst with range [-1,1]. </p>
<p>The Tanh function is </p><p class="formulaDsp">
\[ f(x)=\tanh(x) = \frac 2 {1+exp^(-2x)}-1 \]
</p>
<p> it's derivative can be computed as </p><p class="formulaDsp">
\[ f&#39;(x)= 1-f(x)^2 \]
</p>
 
<p class="definition">Definition at line <a class="el" href="_neuron_layers_8h_source.html#l00052">52</a> of file <a class="el" href="_neuron_layers_8h_source.html">NeuronLayers.h</a>.</p>
</div><h2 class="groupheader">Member Typedef Documentation</h2>
<a id="acc12c52782340838b649e718de0c3507" name="acc12c52782340838b649e718de0c3507"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acc12c52782340838b649e718de0c3507">&#9670;&#160;</a></span>State</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef <a class="el" href="structshark_1_1_empty_state.html">EmptyState</a> <a class="el" href="structshark_1_1_tanh_neuron.html#acc12c52782340838b649e718de0c3507">shark::TanhNeuron::State</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="_neuron_layers_8h_source.html#l00053">53</a> of file <a class="el" href="_neuron_layers_8h_source.html">NeuronLayers.h</a>.</p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a9107cae5619ca79f8fac8a2370b07f81" name="a9107cae5619ca79f8fac8a2370b07f81"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9107cae5619ca79f8fac8a2370b07f81">&#9670;&#160;</a></span>evalInPlace() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class Arg &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void shark::TanhNeuron::evalInPlace </td>
          <td>(</td>
          <td class="paramtype">Arg &amp;&#160;</td>
          <td class="paramname"><em>arg</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="_neuron_layers_8h_source.html#l00055">55</a> of file <a class="el" href="_neuron_layers_8h_source.html">NeuronLayers.h</a>.</p>

<p class="reference">Referenced by <a class="el" href="structshark_1_1_tanh_neuron.html#a017e84210491223766b0498e4bae5028">evalInPlace()</a>.</p>

</div>
</div>
<a id="a017e84210491223766b0498e4bae5028" name="a017e84210491223766b0498e4bae5028"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a017e84210491223766b0498e4bae5028">&#9670;&#160;</a></span>evalInPlace() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class Arg &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void shark::TanhNeuron::evalInPlace </td>
          <td>(</td>
          <td class="paramtype">Arg &amp;&#160;</td>
          <td class="paramname"><em>arg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structshark_1_1_tanh_neuron.html#acc12c52782340838b649e718de0c3507">State</a> &amp;&#160;</td>
          <td class="paramname">&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="_neuron_layers_8h_source.html#l00060">60</a> of file <a class="el" href="_neuron_layers_8h_source.html">NeuronLayers.h</a>.</p>

<p class="reference">References <a class="el" href="structshark_1_1_tanh_neuron.html#a9107cae5619ca79f8fac8a2370b07f81">evalInPlace()</a>.</p>

</div>
</div>
<a id="a89a6085add59e60b91b2ece71e8831d9" name="a89a6085add59e60b91b2ece71e8831d9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a89a6085add59e60b91b2ece71e8831d9">&#9670;&#160;</a></span>multiplyDerivative()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class Output , class Derivative &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void shark::TanhNeuron::multiplyDerivative </td>
          <td>(</td>
          <td class="paramtype">Output const &amp;&#160;</td>
          <td class="paramname"><em>output</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Derivative &amp;&#160;</td>
          <td class="paramname"><em>der</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structshark_1_1_tanh_neuron.html#acc12c52782340838b649e718de0c3507">State</a> const &amp;&#160;</td>
          <td class="paramname">&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="_neuron_layers_8h_source.html#l00065">65</a> of file <a class="el" href="_neuron_layers_8h_source.html">NeuronLayers.h</a>.</p>

<p class="reference">References <a class="el" href="group__shark__globals.html#gae1f82613484173e9fe1a07960dabff63">shark::sqr()</a>.</p>

</div>
</div>
<hr/>The documentation for this struct was generated from the following file:<ul>
<li>include/shark/Models/<a class="el" href="_neuron_layers_8h_source.html">NeuronLayers.h</a></li>
</ul>
</div><!-- contents -->
</div>
</body>
</html>
